﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Pages_CallMain" Codebehind="CallMain.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 88%;
        }
        .style2
        {
        }
        .style4
        {
            width: 162px;
        }
        .style5
        {
            width: 373px;
        }
        .style6
        {
        }
        .style9
        {
            width: 323px;
        }
        .style10
        {
            width: 213px;
        }
        .style11
        {
            width: 268px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
        <asp:Label ID="Label1" runat="server" Text="Filtrar por"></asp:Label>
        <br />
        <table class="style1">
            <tr>
                <td class="style6">
                    <asp:Label ID="Label2" runat="server" Text="Id"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txbId" runat="server"></asp:TextBox>
                </td>
                <td class="style10">
                    <asp:Label ID="Label3" runat="server" Text="Data de Abertura"></asp:Label>
                </td>
                <td class="style4">
                    <asp:TextBox ID="txbDataOpening" runat="server"></asp:TextBox>
                </td>
                <td class="style9" colspan="2">
                    <asp:Label ID="Label4" runat="server" Text="Descrição do Problema"></asp:Label>
                </td>
                <td class="style5" colspan="3">
                    <asp:TextBox ID="txbProblemDescription" runat="server" Width="239px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label5" runat="server" Text="Status"></asp:Label>
                </td>
                <td class="style2">
                    <asp:DropDownList ID="ddlStatus" runat="server">
                    </asp:DropDownList>
                </td>
                <td class="style10">
                    <asp:Label ID="Label6" runat="server" Text="Categoria"></asp:Label>
                </td>
                <td class="style4">
                    <asp:DropDownList ID="ddlCallCategory" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlCallCategory_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="style9" colspan="2">
                    <asp:Label ID="Label7" runat="server" Text="Subcategoria"></asp:Label>
                </td>
                <td class="style5" colspan="3">
                    <asp:DropDownList ID="ddlCallSubCategory" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style6" colspan="3">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    &nbsp;</td>
                <td class="style11">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style6">
                    <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                        style="margin-left: 186px" Text="Pesquisar" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvCall" runat="server" AutoGenerateColumns="False" 
            DataSourceID="odsCall">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                <asp:BoundField DataField="DateOpening" HeaderText="DateOpening" 
                    SortExpression="DateOpening" />
                <asp:BoundField DataField="DateClosing" HeaderText="DateClosing" 
                    SortExpression="DateClosing" />
                <asp:BoundField DataField="ProblemDescription" HeaderText="ProblemDescription" 
                    SortExpression="ProblemDescription" />
                <asp:BoundField DataField="SolutionDescription" 
                    HeaderText="SolutionDescription" SortExpression="SolutionDescription" />
                <asp:DynamicField DataField="CallSubCategory" HeaderText="CallSubCategory" />
                <asp:DynamicField DataField="Sector" HeaderText="Sector" />
                <asp:DynamicField DataField="CallStatus" HeaderText="CallStatus" />
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="odsCall" runat="server" SelectMethod="GetCallByUser" 
            TypeName="br.com.SistemaChamados.Controller.CallController">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="" Name="userOpenId" 
                    SessionField="LoggedUser" Type="Int32" />
                <asp:ControlParameter ControlID="txbId" DefaultValue="" Name="callId" 
                    PropertyName="Text" Type="Int32" />
                <asp:ControlParameter ControlID="txbDataOpening" DefaultValue="" 
                    Name="dateOpening" PropertyName="Text" Type="DateTime" />
                <asp:ControlParameter ControlID="txbProblemDescription" DefaultValue="" 
                    Name="problemDescription" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="ddlCallSubCategory" DefaultValue="" 
                    Name="categoryid" PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlCallSubCategory" DefaultValue="" 
                    Name="subCategoryId" PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
    </div>
    </form>
</body>
</html>
